Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #137 - Add xportr_process() to apply all and write #200

Merged
merged 32 commits into from
Feb 1, 2024

Conversation

EeethB
Copy link
Collaborator

@EeethB EeethB commented Dec 11, 2023

Thank you for your Pull Request!

We have developed a Pull Request template to aid you and our reviewers. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the xportr codebase remains robust and consistent.

The scope of {xportr}

{xportr}'s scope is to enable R users to write out submission compliant xpt files that can be delivered to a Health Authority or to downstream validation software programs. We see labels, lengths, types, ordering and formats from a dataset specification object (SDTM and ADaM) as being our primary focus. We also see messaging and warnings to users around applying information from the specification file as a primary focus. Please make sure your Pull Request meets this scope of {xportr}. If your Pull Request moves beyond this scope, please get in touch with the {xportr} team on slack or create an issue to discuss.

Please check off each task box as an acknowledgment that you completed the task. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the main branch until you have checked off each task.

Changes Description

  • Add a top-level function that applies all other functions and writes XPT

Task List

  • The spirit of xportr is met in your Pull Request
  • Place Closes #<insert_issue_number> into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update)
  • Summary of changes filled out in the above Changes Description. Can be removed or left blank if changes are minor/self-explanatory.
  • Code is formatted according to the tidyverse style guide. Use styler package and functions to style files accordingly.
  • Updated relevant unit tests or have written new unit tests. See our Wiki for conventions used in this package.
  • Creation/updated relevant roxygen headers and examples. See our Wiki for conventions used in this package.
  • Run devtools::document() so all .Rd files in the man folder and the NAMESPACE file in the project root are updated appropriately
  • Run pkgdown::build_site() and check that all affected examples are displayed correctly and that all new/updated functions occur on the "Reference" page.
  • Update NEWS.md if the changes pertain to a user-facing function (i.e. it has an @export tag) or documentation aimed at users (rather than developers)
  • Make sure that the pacakge version in the NEWS.md and DESCRIPTION file is same. Don't worry about updating the version because it will be auto-updated using the vbump.yaml CI.
  • Address any updates needed for vignettes and/or templates
  • Link the issue Development Panel so that it closes after successful merging.
  • Fix merge conflicts
  • Pat yourself on the back for a job well done! Much love to your accomplishment!

@EeethB EeethB linked an issue Dec 11, 2023 that may be closed by this pull request
@EeethB
Copy link
Collaborator Author

EeethB commented Dec 11, 2023

I wrote a very basic version of this function to kick off discussion. It's really just a pipeline calling all the other functions in order. I think if someone really wants a function like this, they could easily write it themselves, and it adds another layer of complexity that feels like it has little payoff. Are there other aspects that could be added to this function to make it more substantial and add more value?

@bms63
Copy link
Collaborator

bms63 commented Dec 12, 2023

I think the wrapper could be very handy for users who are not used to writing R functions.

Also, I typically want everything in xportr when building the xpts so one call to rule them all is nice!!

Copy link
Collaborator

@bms63 bms63 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What abotut xportr_apply_all() or...

xportr_one_ring_to_rule_them()

image

@averissimo
Copy link
Collaborator

averissimo commented Dec 12, 2023

2 more options to consider?

  • xportr() (without any suffix)
    • inspired by {dm} which handles metadata and has a naming structure similar to xportr with dm_*() function names as well as dm()
  • xportr_all()

@bms63
Copy link
Collaborator

bms63 commented Dec 13, 2023

2 more options to consider?

  • xportr() (without any suffix)

    • inspired by {dm} which handles metadata and has a naming structure similar to xportr with dm_*() function names as well as dm()
  • xportr_all()

I like the reasoning for just calling it xportr()

Copy link

codecov bot commented Jan 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9d91212) 100.00% compared to head (8f5fc66) 100.00%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #200   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        14    +1     
  Lines          627       636    +9     
=========================================
+ Hits           627       636    +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

NEWS.md Show resolved Hide resolved
R/xportr.R Outdated Show resolved Hide resolved
R/xportr.R Outdated Show resolved Hide resolved
@EeethB EeethB marked this pull request as ready for review January 11, 2024 16:00
@EeethB EeethB requested a review from bms63 January 11, 2024 16:38
Copy link
Collaborator

@averissimo averissimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ this! Great job!

R/xportr.R Show resolved Hide resolved
Copy link
Collaborator

@averissimo averissimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments between documenation and about reducing test verbosity.

Feature-wise it looks good to me 👍

R/xportr.R Outdated Show resolved Hide resolved
R/xportr.R Show resolved Hide resolved
tests/testthat/test-xportr.R Show resolved Hide resolved
tests/testthat/test-metadata.R Show resolved Hide resolved
tests/testthat/test-metadata.R Outdated Show resolved Hide resolved
tests/testthat/test-metadata.R Show resolved Hide resolved
tests/testthat/test-metadata.R Outdated Show resolved Hide resolved
tests/testthat/test-xportr.R Outdated Show resolved Hide resolved
tests/testthat/test-xportr.R Show resolved Hide resolved
Co-authored-by: André Veríssimo <[email protected]>
@EeethB EeethB mentioned this pull request Jan 22, 2024
Copy link
Collaborator

@averissimo averissimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: should the target branch be the 151_metadata_verbose branch? as this seems to have code from it?

image

README.Rmd Show resolved Hide resolved
@averissimo
Copy link
Collaborator

See #199 (comment)

I won't touch this PR, but it seems that merging that branch here solves all the CI errors 😄

README.Rmd Outdated Show resolved Hide resolved
suppressMessages(
xportr_metadata(adsl, var_spec, domain = "adsl") %>% xportr_type()
xportr_metadata(adsl, var_spec, domain = "adsl", verbose = "none") %>%
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the suppressMEssages still need if this local_message_sink is used?

Copy link
Collaborator

@bms63 bms63 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just had a couple of thoughts on presentation of xportr() in readme and the use of local_message_sink and suppressMessages. Other than that...LGTM!!

@averissimo any other concerns?

@EeethB EeethB merged commit 5675be5 into main Feb 1, 2024
13 checks passed
@EeethB EeethB deleted the 137_apply_all_write branch February 1, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Function to apply all metadata and write
3 participants